package com.hyg.idea.net.exception;

import com.hyg.idea.net.common.ErrorCode;

/**
 * Author: zhpan
 * Date: 2022/5/5
 */
public class BaseException extends RuntimeException {

    protected final int errorCode;

    public BaseException(int errorCode, String cause) {
        super(ErrorCode.getErrorMessage(errorCode), new Throwable(cause));
        this.errorCode = errorCode;
    }

    public int getErrorCode() {
        return errorCode;
    }
}
